<script setup>
import {reactive} from "vue";
import temblorSeal from "@/api/temblor/temblorSeal.js";
import {Message} from "@arco-design/web-vue";

const form = reactive({
  apply_user: [],
  type: 1,
  number: 1,
  cause: '',
  besides: 1 // 是否外带
})
const submit = async () => {
  const res = await temblorSeal.submit(form)
  console.log(res)
  if (res.code === 200) {
    Message.success('提交成功')
    form.apply_user = []
    form.type = 1
    form.number = 1
    form.cause = ''
    form.besides = 1
  } else {
    Message.error(res.message)
  }
}
</script>

<template>
  <a-card>
    <a-form :modelf="form">
      <a-form-item label="申请用户">
        <ma-user v-model="form.apply_user " :isEcho="true" :multiple="false"/>
      </a-form-item>
      <a-form-item label="类型">
        <a-select v-model="form.type">
          <a-option :value="1">公章</a-option>
          <a-option :value="2">电子章</a-option>
          <a-option :value="3">总支章</a-option>
        </a-select>
      </a-form-item>
      <a-form-item label="数量">
        <a-input-number v-model="form.number"></a-input-number>
      </a-form-item>
      <a-form-item label="事由">
        <a-textarea v-model="form.cause"></a-textarea>
      </a-form-item>
      <a-form-item label="是否外带">
        <a-select v-model="form.besides">
          <a-option :value="1">是</a-option>
          <a-option :value="0">否</a-option>
        </a-select>
      </a-form-item>
      <a-form-item>
        <a-button @click="submit" type="primary" status="success">提交</a-button>
      </a-form-item>
    </a-form>
  </a-card>
</template>

<style scoped>

</style>